package com.example.springcloud.zuul.springcloudzuul;

import com.example.springcloud.zuul.springcloudzuul.zuul.TokenFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableZuulProxy // 启用zuul网关代理
public class SpringCloudZuulApplication {

	public static void main(String[] args) {
		SpringApplication.run(SpringCloudZuulApplication.class, args);
	}

	/**
	 * 把 自定义的 filter链加入spring
	 * @return
	 */
	@Bean
	public TokenFilter tokenFilter(){
		return new TokenFilter();
	}

//	/**
//	 * 自定义匹配规则
//	 */
//	@Bean
//	public PatternServiceRouteMapper serviceRouteMapper(){
//		return new PatternServiceRouteMapper("","");
//	}

}
